UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'OSP7tqJ9cZsX/3RLNPuAD4iSJr814vLBXbprleZ725Y=' 
WHERE 
  key_id = '701319992f3f90f9cb2124aff9138efa9a97adfe18525a0e3fdc0df65d0b0a7b' 
  AND (
    token = 'OSP7tqJ9cZsX/3RLNPuAD4iSJr814vLBXbprleZ725Y=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032