UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'DFnuT2plxsF7RUoRvqdrgBkrMGxr4RzswH2lfNmjd2w='
WHERE
key_id = 'fadde34efc32104de02c5bca71b78ec7d00a22cbd676ad50bc016defe83a071b'
AND (
token = 'DFnuT2plxsF7RUoRvqdrgBkrMGxr4RzswH2lfNmjd2w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)