UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'b8mhl0FnuNfqd5/5FCnJHz7mQaKT7EjGlYMW0RNL2kQ='
WHERE
key_id = '28902561d846c05319e8d5c727d2ae3e5919423f869d1702d41daba2014e4026'
AND (
token = 'b8mhl0FnuNfqd5/5FCnJHz7mQaKT7EjGlYMW0RNL2kQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)