UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ndn2QgLyBiupmCxjEpvzTW2nOl4dTAHY6CocxDrSl94='
WHERE
key_id = 'bcf6b9972a8db01ae58606bdfa07a394d8eecc8cfddcdaf543f19f75790f9498'
AND (
token = 'ndn2QgLyBiupmCxjEpvzTW2nOl4dTAHY6CocxDrSl94='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)