UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uOb/plZFHwMyEa24Nww+3hlcgdFQWpAUXJf12ZaBAmQ='
WHERE
key_id = 'b6ee6f8d308967d2fb3ed66f1c89b2e85e33af48510471a78c1f0280030d6c1f'
AND (
token = 'uOb/plZFHwMyEa24Nww+3hlcgdFQWpAUXJf12ZaBAmQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)