UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'R4yZDyUPwEsuZqTR91fSLx8l2nwd07cpX4P91QB9Ga4='
WHERE
key_id = '7f230d6716337f945566669a543c2bf7e3ae1059d98473c3f478710064897f53'
AND (
token = 'R4yZDyUPwEsuZqTR91fSLx8l2nwd07cpX4P91QB9Ga4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)