UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HpAd4CqD/M/udtQchfqrSnGzsVR2Oxaz/MpBiOeyGXg=' 
WHERE 
  key_id = 'cb5c8e5e5fb69e5d6dac0b054f422ed760a6df962af04612dd7ff68025642934' 
  AND (
    token = 'HpAd4CqD/M/udtQchfqrSnGzsVR2Oxaz/MpBiOeyGXg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031