UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'O/qZK3lNThA3U6IhhNzEKSSCzrsWJlSCGa9P0DJQL3M=' 
WHERE 
  key_id = 'a44189086e90ac682d43bf12e25576ecf858f37a9f3738d7bacdea3415367984' 
  AND (
    token = 'O/qZK3lNThA3U6IhhNzEKSSCzrsWJlSCGa9P0DJQL3M=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049