UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PnjT05SdFiF9YsujWz1NILiL8KF9NKvz/7a5OKb8XqE='
WHERE
key_id = '89f715d9b31b9958e85dbc4121c2a2975568ccd2db9af3ae2526d0face3739b7'
AND (
token = 'PnjT05SdFiF9YsujWz1NILiL8KF9NKvz/7a5OKb8XqE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)