UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mCIJLkDn/3+kgdQHDvIaF5CZuBQ0iKsiEjLA9KFiuVk='
WHERE
key_id = 'faad0b3401376371a4a410e0daa26d3a1b98735dd828cb34eb1a9f0d80b97c32'
AND (
token = 'mCIJLkDn/3+kgdQHDvIaF5CZuBQ0iKsiEjLA9KFiuVk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)