UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xPxgSAusJAm6wFz07g00XlyZdsU2OQRmDy/nx83LN4E='
WHERE
key_id = 'c09bc4271340aa02622a781cd4e4d33cfb6d33c68acfea99c84f03d811a94f01'
AND (
token = 'xPxgSAusJAm6wFz07g00XlyZdsU2OQRmDy/nx83LN4E='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)