UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mE2jKIgBh0+V9oLXxgjpHZHrn/IAbl721XK2vu4bPGw='
WHERE
key_id = '85daf2934a4eaacc062a47b5fba6ecc319756a83713560fc9e85325b44a2cc45'
AND (
token = 'mE2jKIgBh0+V9oLXxgjpHZHrn/IAbl721XK2vu4bPGw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)