UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'GovPRbaEHYVHMCQw69J+qsMXMlvZgOX5t13wjnybsN0='
WHERE
key_id = '9a7bde43e341b5b050e6c5160775ce5f06d293ddeca5c2882fdeef8341b90e11'
AND (
token = 'GovPRbaEHYVHMCQw69J+qsMXMlvZgOX5t13wjnybsN0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)