UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iSax8ldXRj5IrAQa7tWCVYZUKKEUD+qflP3pRNG/CAw='
WHERE
key_id = '01159dcac52a0af00abcf33ceeadc01b3757ba6fc51eb34b7666a4573e98aea9'
AND (
token = 'iSax8ldXRj5IrAQa7tWCVYZUKKEUD+qflP3pRNG/CAw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)