UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '0oPOvykIHg/ZYtP/xJ4jtiQDlN7uruC2GwuOG20YNic='
WHERE
key_id = 'bb34729a96f30694b9c9e5db3585c7cf872fffe1e467986e135b09ec2cd242a5'
AND (
token = '0oPOvykIHg/ZYtP/xJ4jtiQDlN7uruC2GwuOG20YNic='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)