UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xX9dMCnc/u85D7A1bLiG5YS2A6T7xU7ekTbcMhz0kPI='
WHERE
key_id = '6ff8cb5b3dfa9340081c4699a4c88b319edee58180d4a413cf8e6abf4fe453cb'
AND (
token = 'xX9dMCnc/u85D7A1bLiG5YS2A6T7xU7ekTbcMhz0kPI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)