UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '9t1ERF2ddEjGT3/LAqXnZE1hYjol+6Kw7fL6TkTlRt4='
WHERE
key_id = '4f2043ad47a56ccb41fb3462e48b9620ff5b922df27dcbac7f6a7eaade2fb237'
AND (
token = '9t1ERF2ddEjGT3/LAqXnZE1hYjol+6Kw7fL6TkTlRt4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)