UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'F7rbPGiRDDv4RSX+/TSUWM9QEw6pExTldY2VxHIPqdI=' 
WHERE 
  key_id = '93dec35d835ce160dd695f126811822d6e5a050d102383c834c4cd7e05315b7e' 
  AND (
    token = 'F7rbPGiRDDv4RSX+/TSUWM9QEw6pExTldY2VxHIPqdI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029