UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'bcFqtZVtze1c2DsAj+XrKTKMb+9CGTukizO6C2qgalI='
WHERE
key_id = 'ec95ef1e8c7cca92092876ec2b6411513f91c5fbd6c7bb36ffe4fd576db888c9'
AND (
token = 'bcFqtZVtze1c2DsAj+XrKTKMb+9CGTukizO6C2qgalI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)