UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SkFMLpZBV8krpyKQyKCO3WY3ZYeB7ipkxeffbJ1BcWc='
WHERE
key_id = '91c9857da05e8ca9d9b94d6fedaf9c37d3704b8c2ccadfe1313bfa5c4d9e0229'
AND (
token = 'SkFMLpZBV8krpyKQyKCO3WY3ZYeB7ipkxeffbJ1BcWc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)