UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6GbEtV7zCWSUml1kO1yFPv4oAeuDswdD0LeYEapOjoY='
WHERE
key_id = 'fdb4471319ca7a0896d447ada2b447a383108d29fb9ac399eae45ec1dc5ae958'
AND (
token = '6GbEtV7zCWSUml1kO1yFPv4oAeuDswdD0LeYEapOjoY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)