UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'tM3sC0GEcal3VzQIZhkcM+HMuXAN4pkysbOrcJVLkzU=' 
WHERE 
  key_id = '53c5dee3418153784df7cea6604564e89d3be0bba9a26c002265c49dea70518f' 
  AND (
    token = 'tM3sC0GEcal3VzQIZhkcM+HMuXAN4pkysbOrcJVLkzU=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019