UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E8YM82Vh0eD0I3D4y4fF9WI1+Esox45BT0T7yfo/PFE=' 
WHERE 
  key_id = '1a60a75d13bd524fdfb347dd823d85e651eecbd589e1bc0b54a6e9a5afc54e07' 
  AND (
    token = 'E8YM82Vh0eD0I3D4y4fF9WI1+Esox45BT0T7yfo/PFE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049