UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'awr6FfBRX1Ah+hgaCdYx2wZGl9A5+F52PllOdVxVDUY=' 
WHERE 
  key_id = '918680414749df4becbee0a3d9862d91d0006e670538ba9eb758f9fdfb63aeea' 
  AND (
    token = 'awr6FfBRX1Ah+hgaCdYx2wZGl9A5+F52PllOdVxVDUY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026