UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tVmQt431gTo8+MQgJ+nhFKlcYGNUf1B/CUIVdzRlELg=' 
WHERE 
  key_id = '9394174fc48be0a86f0af9d42c7820c6009f573c9f52593a2ef675ed37b39f4c' 
  AND (
    token = 'tVmQt431gTo8+MQgJ+nhFKlcYGNUf1B/CUIVdzRlELg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023