UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WTITjwXoGuaSTEHk3CG2X+VRd6wGaYYIXx7GFt/qosk='
WHERE
key_id = '0c376a7a34720caf8ba27fe842f39f5fb759221796276746ed8c2a7d9c08f881'
AND (
token = 'WTITjwXoGuaSTEHk3CG2X+VRd6wGaYYIXx7GFt/qosk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)