UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'fi86CRSjQ6VihXgZ1l3uvlF+5vr5uaM93EZo4DHS7MM='
WHERE
key_id = '08e514670e281f943f1f1eaabfda58e23e0e117248b318622dd2c840ccca41cc'
AND (
token = 'fi86CRSjQ6VihXgZ1l3uvlF+5vr5uaM93EZo4DHS7MM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)