UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9TXP/Dkt8IYtXKv9KrKyWAsjg5cf54xA7Fa/8sNHPQw='
WHERE
key_id = '8cf0a874062d51266652d91bba68b8f7ed2d4c52c3c9bdb41768071ff17d6d7b'
AND (
token = '9TXP/Dkt8IYtXKv9KrKyWAsjg5cf54xA7Fa/8sNHPQw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)