UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'wQ81igHuzouIOWySN9Lu/qelO7HOYQKVFi5XF4xDmAE=' 
WHERE 
  key_id = '5af1c67db356ee1332973d3901104af8d61b71fa394a4e68d3ff20c72a4ce0d4' 
  AND (
    token = 'wQ81igHuzouIOWySN9Lu/qelO7HOYQKVFi5XF4xDmAE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021