UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'qHW+7o0/EfVfdWFipsE3qe7G03JxW+gEuK3RNY8OqlQ='
WHERE
key_id = '1c7ee8d634fecf60c5728a2cdc7c9f0591433f538f0effee2e17853fe3c81efb'
AND (
token = 'qHW+7o0/EfVfdWFipsE3qe7G03JxW+gEuK3RNY8OqlQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)