UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OoMnxZ+6DClYI3QvZnBAXS6HPAGFyjLh3qDl8cBfRoI='
WHERE
key_id = 'd1c31166d70f3e5e2d6de1f43d649710e2d71ee74543d8e22286a38579c4f95d'
AND (
token = 'OoMnxZ+6DClYI3QvZnBAXS6HPAGFyjLh3qDl8cBfRoI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)