UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Qg5N8sNENlDCKYbDqRsmIhPaRenkpluFfSGkGx2NuFY='
WHERE
key_id = '21786ac5c1d23894266749f27a35333bda682b7c4b1620b106f932b214528606'
AND (
token = 'Qg5N8sNENlDCKYbDqRsmIhPaRenkpluFfSGkGx2NuFY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)