UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'lfzf+5vlUTGF5QzLnE3H/jZESDJjF9D/+aMGpVMxb6o='
WHERE
key_id = '1cf5349b8ff58d5e4793820dc94b42df16fcc8e820ce431d9f0b9cd41ef668b8'
AND (
token = 'lfzf+5vlUTGF5QzLnE3H/jZESDJjF9D/+aMGpVMxb6o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)