UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sHNisp5wACDJWNeL1rQhcDG3/witcDHDJncaNQwNZZE='
WHERE
key_id = '381ab8f662ab4da39dc4e8ff97b871488416b08df1594d0b11cc5b1da384ba55'
AND (
token = 'sHNisp5wACDJWNeL1rQhcDG3/witcDHDJncaNQwNZZE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)