UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'oSQnfUhJGF1AsGJa6/IQDjVbO7odTkebh+H21Zga6d8='
WHERE
key_id = '6d5d0b3a8c4d2d9ef84b351cff9627b8f912dc11a33bda9818531aaceb64ffe8'
AND (
token = 'oSQnfUhJGF1AsGJa6/IQDjVbO7odTkebh+H21Zga6d8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)