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