UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'AZBPjyVWOC1GphTO26eyc01Ey31GNxoQ/mXYl8V0W4g=' 
WHERE 
  key_id = '0142b688761618ca2280839d2104c29a8f4a70157ac77aa65d09619032a7a5cf' 
  AND (
    token = 'AZBPjyVWOC1GphTO26eyc01Ey31GNxoQ/mXYl8V0W4g=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045