UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'hNRP9bVeRC5WopJDk/LGs2Ih5Y4poGngTYSEvZbMxn0='
WHERE
key_id = '8d4a7f3a44f2b5ecc1ec11435f70618ea7bf0e85e475a749d805c6e0ccc994fd'
AND (
token = 'hNRP9bVeRC5WopJDk/LGs2Ih5Y4poGngTYSEvZbMxn0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)