UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'UmGCW9EtKTmBUTNl7Mrvt7wA2MWQSzRUYYj+fFuYjN4='
WHERE
key_id = '71ab529c301675ed8de229135a6c573e8ac92bb599cafcd7e5534f741f810293'
AND (
token = 'UmGCW9EtKTmBUTNl7Mrvt7wA2MWQSzRUYYj+fFuYjN4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)