UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oPyf4jTs5iM5fYD4ZfmW+4HmAV3W/eq/ZfwvN9sSy7k='
WHERE
key_id = '6f0e9f2d3d322db8d617a57904d8c7aa86248dd091bb71c57eeafbf95d17f223'
AND (
token = 'oPyf4jTs5iM5fYD4ZfmW+4HmAV3W/eq/ZfwvN9sSy7k='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)