UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'wIwSVuDfppcnobOHh+iCd6+4mMBjgAjUiRQG7bPSWuU='
WHERE
key_id = 'a75fc3e21c5b19d11bc357552387ec5e32e07de3db3dcd6875947eb61e4bbd3f'
AND (
token = 'wIwSVuDfppcnobOHh+iCd6+4mMBjgAjUiRQG7bPSWuU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)