UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xyIUR72dHNKlM31CkWce57PRxTbTAXsOISyJYrPgTdI='
WHERE
key_id = 'fc0b3bee59305081f775b9faaee1875440f5fd63af82206caf0081d8f5711fab'
AND (
token = 'xyIUR72dHNKlM31CkWce57PRxTbTAXsOISyJYrPgTdI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)