UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '34j92/Hq4Q0p/stw9yrfSCZINmzyhM0+NPCPtNJ25Kw='
WHERE
key_id = '400568f30bab5646daa51f6b279a4b5ed4be78130e2f044aa2d853ca119e73ba'
AND (
token = '34j92/Hq4Q0p/stw9yrfSCZINmzyhM0+NPCPtNJ25Kw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)