UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bk+ScG3mTRp04x4MPRrxSBBZ5Do7essNTrYARaAMq/U='
WHERE
key_id = '41a278ed6befb3cd99b05c635a9fdbc4781f7e5e1f29466f00d3c2f97ea5dd8b'
AND (
token = 'bk+ScG3mTRp04x4MPRrxSBBZ5Do7essNTrYARaAMq/U='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)