UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'YYelEAhYzQ951RJDXTL2d9sTjMbZ4zz2KgxwwJzY6hY=' 
WHERE 
  key_id = 'e0538dfbb41d99183997eb041b0ea7e0387eb719cea648fc5b3fbf45a930f551' 
  AND (
    token = 'YYelEAhYzQ951RJDXTL2d9sTjMbZ4zz2KgxwwJzY6hY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040